package com.etc.service.impl;

import com.etc.dao.AdContentMapper;
import com.etc.entity.AdContent;
import com.etc.service.AdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdServiceImpl implements AdService {

    @Autowired
    AdContentMapper adContentMapper;

    @Override
    public List<AdContent> selectAllAd() {
        return adContentMapper.selectAllAd();
    }

    @Override
    public boolean deleteThisId(Long id) {
        int i = adContentMapper.deleteByPrimaryKey(id);
        return i>0?true:false;
    }

    @Override
    public List<AdContent> dofind(Long categoryid3) {
        return adContentMapper.findAllByCategoryid(categoryid3);
    }
}
